import { Component, OnInit } from '@angular/core';
import {SimplePendingTask, Tasks} from "../../shared/PendingTask";
import {BackApiService} from "../back-api.service";
import {ActivatedRoute, Router} from "@angular/router";
import {PageTitleService} from "../page-title.service";

@Component({
  selector: 'app-finish-tasks',
  templateUrl: './finish-tasks.component.html',
  styleUrls: ['./finish-tasks.component.scss']
})
export class FinishTasksComponent extends Tasks implements OnInit {


  tasks: SimplePendingTask[];

  constructor(
    protected _taskService: BackApiService,
    protected _router: Router,
    protected _routerActive: ActivatedRoute,
    protected _pageTitle: PageTitleService,
  ) {
    super(_router , _pageTitle,_routerActive,_taskService);
  }

  title(): string { return "完成任务"}

  ngOnInit() {
    this.getTasks();
  }

  getTasks(): void {
    this._taskService.getFinishs().then((datas => {
      this.tasks = datas;
    }))
  }

}
